You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@lumino/widgets

Package Overview
Dependencies
Maintainers
7
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lumino/widgets

Lumino Widgets


Version published
Maintainers
7
Created

Package description

What is @lumino/widgets?

@lumino/widgets is a library for building complex, high-performance web applications with a focus on modularity and flexibility. It provides a set of widgets and layout management tools that can be used to create sophisticated user interfaces.

What are @lumino/widgets's main functionalities?

Creating a Simple Widget

This code demonstrates how to create a simple widget using @lumino/widgets. The widget displays 'Hello, Lumino!' and attaches itself to the document body.

const { Widget } = require('@lumino/widgets');

class MyWidget extends Widget {
  constructor() {
    super();
    this.node.textContent = 'Hello, Lumino!';
  }
}

const widget = new MyWidget();
widget.attach(document.body);

Layout Management

This code demonstrates how to use the BoxLayout to manage the layout of multiple widgets. Two widgets are created and added to a BoxLayout, which is then set as the layout for a main widget that is attached to the document body.

const { Widget, BoxLayout } = require('@lumino/widgets');

const layout = new BoxLayout({ direction: 'left-to-right' });
const widget1 = new Widget();
widget1.node.textContent = 'Widget 1';
const widget2 = new Widget();
widget2.node.textContent = 'Widget 2';

layout.addWidget(widget1);
layout.addWidget(widget2);

const mainWidget = new Widget();
mainWidget.layout = layout;
mainWidget.attach(document.body);

DockPanel for Complex Layouts

This code demonstrates how to use the DockPanel for more complex layouts. Two widgets are created and added to a DockPanel, with the second widget being docked to the right of the first widget. The DockPanel is then attached to the document body.

const { Widget, DockPanel } = require('@lumino/widgets');

const dock = new DockPanel();
const widget1 = new Widget();
widget1.node.textContent = 'Docked Widget 1';
const widget2 = new Widget();
widget2.node.textContent = 'Docked Widget 2';

dock.addWidget(widget1);
dock.addWidget(widget2, { mode: 'split-right', ref: widget1 });

dock.attach(document.body);

Other packages similar to @lumino/widgets

FAQs

Package last updated on 27 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc